package com.wuzheng.wisgo.sanitation.cloud.repository.mapper.transfer;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.wuzheng.wisgo.sanitation.cloud.model.transfer.param.TransferRouteAddParam;
import com.wuzheng.wisgo.sanitation.cloud.repository.entity.transfer.TransferRouteTrash;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 转运路线与垃圾桶关系 Mapper 接口
 * </p>
 *
 * @author hoipang
 * @since 2019-12-06
 */
public interface TransferRouteTrashMapper extends BaseMapper<TransferRouteTrash> {

    @Select("SELECT ba_transfer_route_trash.trash_id,ba_facility.facility_name\n" +
            "FROM ba_transfer_route_trash\n" +
            "LEFT JOIN ba_facility ON ba_facility.id=ba_transfer_route_trash.trash_id\n" +
            "WHERE ba_transfer_route_trash.transfer_route_id=#{transferRouteId}")
    List<TransferRouteAddParam> selectTrasfNameByRouteId(@Param("transferRouteId") String transferRouteId);
}
